﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Weka;


//FOR TESTING PURPOSES ONLY

namespace Test
{
    //A standard deserliser is defined like this.
    //It finds all the classes marked with a MessageIdAttribute, in the assemble it is defined in.
    internal class StandardDeserliser : Deserliser { }

    //This is the nonstandard way of defining a Deserliser and is only does so we can test different message versions.
    internal class DeserliserVersion1 : Deserliser
    {
        public override Type GetMessageType(byte messageId)
        {
            if (messageId == 33) return typeof(Version1.Earth);
            if (messageId == 14) return typeof(Version1.Country);

            return base.GetMessageType(messageId);
        }
    }
    internal class DeserliserVersion2 : Deserliser
    {
        public override Type GetMessageType(byte messageId)
        {
            if (messageId == 33) return typeof(Version2.Earth);
            if (messageId == 14) return typeof(Version2.Country);
            if (messageId == 17) return typeof(Version2.Ocean);
            if (messageId == 15) return typeof(Version2.Town);

            return base.GetMessageType(messageId);
        }
    }
    internal class DeserliserVersion3 : Deserliser
    {
        public override Type GetMessageType(byte messageId)
        {
            if (messageId == 33) return typeof(Version3.Earth);
            if (messageId == 14) return typeof(Version3.Country);
            if (messageId == 17) return typeof(Version3.Ocean);
            if (messageId == 15) return typeof(Version3.Town);

            return base.GetMessageType(messageId);
        }
    }
}
